33. Monte Carlo Techniques 33.1. Sampling the Uniform Distribution 33.2. Inverse Transform Method
نویسنده
چکیده
Monte Carlo techniques are often the only practical way to evaluate difficult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. Most Monte Carlo sampling or integration techniques assume a " random number generator, " which generates uniform statistically independent values on the half open interval [0, 1); for reviews see, e.g.,[1, 2]. Uniform random number generators are available in software libraries such as CERNLIB [3], CLHEP [4], and ROOT [5]. For example, in addition to a basic congruential generator TRandom (see below), ROOT provides three more sophisticated routines: TRandom1 implements the RANLUX generator [6] based on the method by Lüscher, and allows the user to select different quality levels, trading off quality with speed; TRandom2 is based on the maximally equidistributed combined Tausworthe generator by L'Ecuyer [7]; the TRandom3 generator implements the Mersenne twister algorithm of Matsumoto and Nishimura [8]. All of the algorithms produce a periodic sequence of numbers, and to obtain effectively random values, one must not use more than a small subset of a single period. The Mersenne twister algorithm has an extremely long period of 2 19937 − 1. The performance of the generators can be investigated with tests such as DIEHARD [9] or TestU01 [10]. Many commonly available congruential generators fail these tests and often have sequences (typically with periods less than 2 32), which can be easily exhausted on modern computers. A short period is a problem for the TRandom generator in ROOT, which, however, has the advantage that its state is stored in a single 32-bit word. The generators TRandom1, TRandom2, or TRandom3 have much longer periods, with TRandom3 being recommended by the ROOT authors as providing the best combination of speed and good random properties. If the desired probability density function is f (x) on the range −∞ < x < ∞, its cumulative distribution function (expressing the probability that x ≤ a) is given by Eq. (31.6). If a is chosen with probability density f (a), then the integrated probability up to point a, F (a), is itself a random variable which will occur with uniform probability density on [0, 1]. If x can take on any value, and ignoring the endpoints, we can then find a unique x chosen from the p.d.f. f (s) for a given u if we set …
منابع مشابه
33.1. Sampling the Uniform Distribution 33.2. Inverse Transform Method
Monte Carlo techniques are often the only practical way to evaluate difficult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. Most Monte Carlo sampling or integration techniques assume a " random number generator, " which generates uniform ...
متن کاملAttenuation Correction in SPECT during Image Reconstruction using an Inverse Monte Carlo Method: A Simulation Study
Introduction: The main goal of SPECT imaging is to determine activity distribution inside the organs of the body. However, due to photon attenuation, it is almost impossible to do a quantitative study. In this paper, we suggest a mathematical relationship between activity distribution and its corresponding projections using a transfer matrix. Monte Carlo simulation was used to find a precise tr...
متن کامل34.1. Sampling the Uniform Distribution 34.2. Inverse Transform Method
Monte Carlo techniques are often the only practical way to evaluate difficult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. Most Monte Carlo sampling or integration techniques assume a " random number generator, " which generates uniform ...
متن کامل37.1. Sampling the Uniform Distribution 37.2. Inverse Transform Method
Monte Carlo techniques are often the only practical way to evaluate difficult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. Most Monte Carlo sampling or integration techniques assume a " random number generator, " which generates uniform ...
متن کامل34.1. Sampling the Uniform Distribution 34.2. Inverse Transform Method
Monte Carlo techniques are often the only practical way to evaluate difficult integrals or to sample random variables governed by complicated probability density functions. Here we describe an assortment of methods for sampling some commonly occurring probability density functions. Most Monte Carlo sampling or integration techniques assume a " random number generator, " which generates uniform ...
متن کامل